package com.leha.forum.lehare.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;

@TableName("third_party_login") // 对应数据库表名
public class ThirdPartyLogin {
    /**
     * 第三方登录记录ID（数据库自增）
     */
    @TableId(value = "third_id", type = IdType.AUTO)
    private Integer thirdId;

    /**
     * 用户ID（对应 user_id 列）
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 第三方平台类型（数据库枚举约束）
     */
    @TableField("third_type")
    private String thirdType;

    /**
     * 第三方开放ID（对应 third_openid 列）
     */
    @TableField("third_openid")
    private String thirdOpenid;

    /**
     * 创建时间（自动填充）
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private Date createdAt;

    /**
     * 最后更新时间（自动填充）
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    // 无参构造函数（MyBatis-Plus 需要）
    public ThirdPartyLogin() {
    }

    // 可选：带必要参数的构造函数
    public ThirdPartyLogin(Integer userId, String thirdType, String thirdOpenid) {
        this.userId = userId;
        this.thirdType = thirdType;
        this.thirdOpenid = thirdOpenid;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setThirdId(Integer thirdId) {
        this.thirdId = thirdId;
    }

    public void setThirdOpenid(String thirdOpenid) {
        this.thirdOpenid = thirdOpenid;
    }

    public void setThirdType(String thirdType) {
        this.thirdType = thirdType;
    }

    public Integer getThirdId() {
        return thirdId;
    }

    public String getThirdOpenid() {
        return thirdOpenid;
    }

    public String getThirdType() {
        return thirdType;
    }
}